package com.biaoyoo.www.personapp.activity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import com.biaoyoo.www.personapp.PersonApp;
import com.biaoyoo.www.personapp.R;
import com.biaoyoo.www.personapp.constant.ConstantValue;

import java.util.ArrayList;

public class MainActivity extends BaseActivity {

    private TextView mMainTv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void loadViews() {
        setContentView(R.layout.activity_main,R.string.main_activity,R.menu.menu_home, ConstantValue.TOOLBAR_MODE_BACK);
        mMainTv = (TextView) findViewById(R.id.tv_main);

    }

    @Override
    protected void initDatas() {

        PersonApp.gArrayList = new ArrayList<>();
        PersonApp.gArrayList.add("test1");
        PersonApp.gArrayList.add("test2");
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
//        String isExitApp = intent.getStringExtra("isExitApp");
        Bundle extras = intent.getExtras();
        String isExitApp = extras.getString("isExitApp");

        if("1".equals(isExitApp)){ //说明后台直接杀死
            startActivity(new Intent(MainActivity.this,WelcomeActivity.class));
            finish();
        }
    }
}
